<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:wh="http://java.sun.com/jsf/composite/wh"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="template/companyTemplate.xhtml">
		<ui:define name="companyContent">
			<f:view>
				
				<h:form id="productDetails">
					<h1>Product Details</h1>
					<p>
						On this page you find the product information in detail. 
						The product quality is always a number between 0 and 1. 
						0 is a very bad quality whereas 1 is a very high quality product.
					</p>
					<h:panelGrid columns="2" cellpadding="5">

						<h:outputLabel for="prodName" value="Product-Name:" />
						<h:outputText id="prodName"
							value="#{companyMBean.selectedProduct.name}" />
						 
						<h:outputLabel for="prodQuality" value="Exact-Product-Quality (0-1):" />
						<h:outputText id="prodQuality"
							value="#{companyMBean.selectedProduct.qualityFactor}" />
						
						<h:outputLabel for="qualityRating" value="Quality Rating:" />
        				<p:rating id="qualityRating" value="#{companyMBean.selectedProduct.getQualityFactorStars()}" stars="5" readonly="true" />

						<h:outputLabel for="prodCosts" value="Product-Costs:" />
						<h:outputText id="prodCosts"
							value="#{companyMBean.selectedProduct.productCosts}" />

						<h:outputLabel for="prodSupplierName" value="Supplier-Name:" />
						<h:outputText id="prodSupplierName"
							value="#{companyMBean.selectedProduct.supplier.supplierName}" />

					</h:panelGrid>
					<br></br>
					<p:commandButton value="To Product-Selection"
						action="companyProductOverview?faces-redirect=true" />
					<p:commandButton value="To Selected Products"
						action="companySelectedProductsForSale?faces-redirect=true" />
				</h:form>
			</f:view>
		</ui:define>
	</ui:composition>
</h:body>
</html>